import React from 'react';
import {
  Col,
  Form,
  Modal, Row,
} from 'antd';

import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;

//查看详情
const DescView = Form.create()(props => {
  const { lookDescView, handleLookDesc, selectedRows } = props;
  console.log(selectedRows);
  return (
    <Modal
      destroyOnClose
      title="规则信息"
      visible={lookDescView}
      width={650}
      onOk={() => handleLookDesc(false,[])}
      onCancel={() => handleLookDesc(false, [])}>
      <DescriptionList size="large" style={{ marginBottom: 32 }} col="1">

        {selectedRows.rewardType === 1 ?
          [<Description  term="首投金额（万元）">
            <Row type="flex" justify="left">
              {selectedRows.limitRules.map((item, index) => {
                return <Col md={3} sm={24}>{item}</Col>;
              })}
            </Row>
          </Description>,
            <Description term="奖励金额（元）">
              <Row type="flex" justify="left">
                {selectedRows.limitValues.map((item, index) => {
                  return <Col md={3} sm={24}>{item}</Col>;
                })}
              </Row>
            </Description>]
          : [<Description term="总资产（万元）">
            <Row type="flex" justify="left">
              {selectedRows.limitRules.map((item, index) => {
                return <Col md={3} sm={24}>{item}</Col>;
              })}
            </Row>
          </Description>,
            <Description term="返佣比例（%）">
              <Row type="flex" justify="left">
                {selectedRows.limitValues.map((item, index) => {
                  return <Col md={3} sm={24}>{item}</Col>;
                })}
              </Row></Description>]}
      </DescriptionList>
    </Modal>
  );
});

export default DescView;
